﻿using System;
using System.Collections.Generic;
using System.Text;
using WySpecialtyFacadeTest.Specialty;

namespace WySpecialtyFacadeTest
{
    public class WySpecialty
    {

        private readonly Specialty1 _specialty1;//红鲤
        private readonly Specialty2 _specialty2;//绿茶
        private readonly SpeCialty3 _speCialty3;//酒槽
        private SelectSucces _selectSucces;
        public WySpecialty(Specialty1 specialty1, Specialty2 specialty2, SpeCialty3 speCialty3, SelectSucces selectSucces)
        {
            this._specialty1 = specialty1;
            this._specialty2 = specialty2;
            this._speCialty3 = speCialty3;
            this._selectSucces = selectSucces;
        }
        public void Shopping(int shop)
        {
            if (shop == 1)
            {
                _specialty1.SelectCarp();

            }
            else if (shop == 2)
            {
                _specialty1.Cancel();
            }
            else if (shop == 3)
            {
                _specialty2.SelectTea();
            }
            else if (shop == 4)
            {
                _specialty2.Cancel();
            }
            else if (shop == 5)
            {
                _speCialty3.SelectLiquor();
            }
            else if (shop == 6)
            {
                _speCialty3.Cancel();
            }
            else if (shop == 8)
            {
                _specialty1.SelectCarp();
                _specialty2.SelectTea();
                _speCialty3.SelectLiquor();
                
            }
            else if (shop == 9)
            {
                _selectSucces.Successful();
            }
            else 
            {
                _specialty1.Cancel();
                _specialty2.Cancel();
                _speCialty3.Cancel();
            }
        }

        public void SpeList(string spe)
        {
            _specialty1.PouchRedCarp(spe);
            _specialty2.GreenTea(spe);
            _speCialty3.Liquor(spe);
        }

    }
}
